package com.peza.homecontrol.domain;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;

@Entity
public class Module implements Serializable {

	private static final long serialVersionUID = 1L;

	@Column
	private long id;
	
	@Column
	private String name;
	
	@Column
	private String channel;
	
	@Column
	private Integer code;
	
	@Column
	private Boolean active;
	
	@Column
	private Integer setting;
	
	
	public Module(){
		
	}
	
	
	public Module(String name, int id, String channel, int code, boolean enabled, int setting){
		this.name = name;
		this.id = id;
		this.channel = channel;
		this.code = code;
		this.active = enabled;
		this.setting = setting;
	}

	public Module(String name, int id, int code, boolean enabled, int setting){
		this.name = name;
		this.id = id;
		this.code = code;
		this.active = enabled;
		this.setting = setting;
	}
	

	public String getName() {
		return name;
	}


	public void setName(String name) {
		this.name = name;
	}


	public long getId() {
		return id;
	}


	public void setId(long id) {
		this.id = id;
	}


	public String getChannel() {
		return channel;
	}


	public void setChannel(String channel) {
		this.channel = channel;
	}


	public Integer getCode() {
		return code;
	}


	public void setCode(Integer code) {
		this.code = code;
	}


	public Boolean isActive() {
		return active;
	}


	public void setActive(Boolean active) {
		this.active = active;
	}


	public Integer getSetting() {
		return setting;
	}


	public void setSetting(Integer setting) {
		this.setting = setting;
	}


	public void flip() {
		if (active){
			setActive(false);
		} else {
			setActive(true);
		}
		
	}
	
}
